package com.hmall.user.utils;

public class UserHolder {
    public static final ThreadLocal<Long>threadLocal=new ThreadLocal<>();
    public static void init(Long userId) {
        threadLocal.set(userId);
    }
    public static Long getUserId() {
        return threadLocal.get();
    }
    public static void remove() {
        threadLocal.remove();

    }
}
